<script setup>
import { defineProps } from 'vue';
const props = defineProps({
    text: {
        type: String,
        default: 'GitHub'
    },
    icon: {
        type: String,
        default: '#icon-github'
    },
    url: {
        type: String,
        default: 'https://github.com/lin-xin/vue-manage-system'
    }
})
const onClick=()=>{
    window.open(props.url)
}

</script>

<template>
    <div class="lin-btn-tag" @click="onClick">
        <div class="lin-btn-tag-content">
            <svg class="icon" aria-hidden="true">
                <use :xlink:href="icon"></use>
            </svg>
            <span>{{ text }}</span>
        </div>
        <button></button>
    </div>
</template>

<style lang="scss" scoped>
.lin-btn-tag {
    position: relative;
    width: 100%;
    height: 28px;
    border-radius: 5px;
    overflow: hidden;
    border: none;
    background-color: #F8F8F8;
    color: #777777;
    font-size: 14px;
    cursor: pointer;
    transition: all .3s;
    margin-top: 4px;
    margin-bottom: 8px;
    box-shadow: 0 0 2px rgba(0, 0, 0, .2);

    .lin-btn-tag-content {
        display: flex;
        align-items: center;
        justify-content: left;
        width: 100%;
        height: 100%;
        border-radius: 5px;
        overflow: hidden;
        border: none;
        font-size: 14px;
        line-height: 14px;

        .icon {
            width: 12px;
            height: 12px;
            margin-left: 5px;
            margin-right: 5px;
        }

        span {
            font-size: 12px;
            line-height: 12px;
        }
    }

    button {
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        border: none;
        background-color: transparent;
        font-size: 14px;
        cursor: pointer;
        transition: all .3s;
    }

    &:hover {
        box-shadow: -2px 6px 20px rgba(0, 0, 0, .2);
    }
}
</style>